home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / System / XADmaster / xad_dev / Include / Autodocs / xadmaster.doc next >
Encoding:
Text File  |  2001-04-01  |  62.0 KB  |  1,607 lines

  1. TABLE OF CONTENTS
  2.  
  3. xadmaster.library/--general--
  4. xadmaster.library/xadAddDiskEntry
  5. xadmaster.library/xadAddFileEntry
  6. xadmaster.library/xadAllocObject
  7. xadmaster.library/xadAllocVec
  8. xadmaster.library/xadCalcCRC16
  9. xadmaster.library/xadCalcCRC32
  10. xadmaster.library/xadConvertDates
  11. xadmaster.library/xadConvertProtection
  12. xadmaster.library/xadCopyMem
  13. xadmaster.library/xadDiskUnArc
  14. xadmaster.library/xadDiskFileUnArc
  15. xadmaster.library/xadFileUnArc
  16. xadmaster.library/xadFreeInfo
  17. xadmaster.library/xadFreeHookAccess
  18. xadmaster.library/xadFreeObject
  19. xadmaster.library/xadGetClientInfo
  20. xadmaster.library/xadGetDiskInfo
  21. xadmaster.library/xadGetErrorText
  22. xadmaster.library/xadGetInfo
  23. xadmaster.library/xadGetHookAccess
  24. xadmaster.library/xadHookAccess
  25. xadmaster.library/xadHookTagAccess
  26. xadmaster.library/xadRecogFile
  27. xadmaster.library/--tags--
  28. xadmaster.library/--data hooks--
  29. xadmaster.library/--progress hooks--
  30.  
  31. VERSION
  32.         $VER: xadmaster.doc 10.0 (11.03.2001) by SDI
  33.  
  34. xadmaster.library/--general--                   xadmaster.library/--general--
  35.  
  36.     This library gives you an interface to extract data from file or disk
  37.     archives.
  38.  
  39.     When unachiving a archive you need to do following steps always
  40.     1) Allocate a "struct xadArchiveInfo" with a call to
  41.        xadAllocObjectA(XADOBJ_ARCHIVEINFO, 0). This structure is the master
  42.        interface and must not by modified in any way. Nearly all other
  43.        functions you may use need to get the pointer this this structure.
  44.        All data is passed with tags!
  45.  
  46.     2a)Call xadGetInfo() to find out if the input data is archived. If it
  47.        is, the xadArchiveInfo structure is filled with lots of information
  48.        (but the structure may contain empty lists!).
  49.        See xadGetInfo() description to see what you may read and what stuff
  50.        not. One of the input tags must be specified here to specify one 
  51.        of the allowed input stream methods.
  52.  
  53.     2b)Call xadGetDiskInfo() to find out if input data is filesystem data.
  54.  
  55.     Goto step 5 if step 2 returns error code!
  56.  
  57.     3) For every file in a file archive or every disk call xadFileUnArc() or
  58.        xadDiskUnArc() (or xadDiskFileUnArc() if you did step 2b) with one tag
  59.        XAD_ENTRYNUMBER set to wanted entry. One of the output tags must be
  60.        specified here.
  61.        Passwords and other stuff is additionally allowed and sometimes
  62.        required.
  63.  
  64.     4) Call xadFreeInfo() to free the stuff allocated with xadGetInfo() or
  65.        xadGetDiskInfo().
  66.  
  67.     5) Use xadFreeObjectA() to free the xadArchiveInfo structure.
  68.  
  69.     If using xadGetDiskInfo(), there maybe multiple filesystems on one disk.
  70.     If one is detected, do another run and use XAD_STARTCLIENT in step 2b).
  71.     If you detected disk archives, it maybe useful to scan them for file-
  72.     systems as well.
  73.  
  74.     Do not use one xadArchiveInfo file structure for multiple input files!
  75.     
  76.     ANY needed structure must be allocated with xadAllocObject()! None of
  77.     the xadmaster structures can be allocated any other way!
  78.  
  79.     There exist lots of tags, which can be passed to the functions of this
  80.     library. Some of these are repeated in the xadArchiveInfo communication
  81.     structure. Do NEVER set this flags or values directly, but always use
  82.     the corresponding tags. The handling of these elements possibly will
  83.     change, but the tags will stay valid always!
  84.  
  85.     I know there are lots of flags which have long and strange names. The
  86.     method is not so complicated as you may think. They always follow following
  87.     guideline: XADxxY_zzzzz
  88.     xx - short name of their structure (AI - xadArchiveInfo, DI - xadDiskInfo,
  89.          C - xadClient, ...)
  90.     Y  - F for flag or B for bit value
  91.     zz - The flag name itself
  92.     So XADPIF_OVERWRITE is a flag for xadProgressInfo, which is called
  93.     OVERWRITE and XADAIB_OVERWRITE is a bit value for xadArchiveInfo structure.
  94.     
  95.     Also all the structure elements cover a short prefix indicating the name
  96.     of the master structure (xfi for xadFileInfo, xc for xadClient, ...). So
  97.     you can always check if your code is valid by comparing the prefixes.
  98.  
  99. xadmaster.library/xadAddDiskEntry           xadmaster.library/xadAddDiskEntry
  100.  
  101.     NAME
  102.         xadAddDiskEntry - Add disk entry to list of entries (V10)
  103.  
  104.     SYNOPSIS
  105.         result = xadAddDiskEntryA(di, ai, tags)
  106.         D0                        A0  A1   A2
  107.  
  108.         LONG xadAddDiskEntryA(struct xadDiskInfo *, struct xadArchiveInfo *,
  109.              struct TagItem *)
  110.  
  111.         result = xadAddDiskEntry(di, ai, tag1, ...)
  112.  
  113.         LONG xadAddDiskEntry(struct xadDiskInfo *, struct xadArchiveInfo *,
  114.              Tag, ...)
  115.  
  116.     FUNCTION
  117.         This function adds a newly created struct xadDiskInfo to the list of
  118.         entries and supports a hook call mechanism for user side interaction.
  119.         This should be used always instead of old-style selfmade lists.
  120.         Some important notes:
  121.         a) Never modify the lists yourself, if the two add-functions are used.
  122.         b) Use XADDIF_EXTRACTONBUILD, if the entry can be extracted during
  123.            this function call. Normally this requires the tag XAD_SETINPOS
  124.            also to get an determined file pointer afterwards.
  125.         c) An entry should be finished, when adding it to list. At least the
  126.            public information must be completed. Private information may be
  127.            added later (but this most time means XADDIF_EXTRACTONBUILD is
  128.            impossible).
  129.         d) Always check return code and react on it. This is necessary
  130.            especially to support XADERR_BREAK. In case XADERR_BREAK is
  131.            returned the work should be aborted in any case.
  132.  
  133.     INPUT
  134.         ai      - the master communication structure
  135.         fi      - the file info structure, which should be added to list
  136.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  137.                   XAD_SETINPOS
  138.  
  139.     RESULT
  140.         result  - any of the XADERR codes or zero when all is ok.
  141.  
  142.     SEE ALSO
  143.         libraries/xadmaster.h, xadAddFileEntry(), tags section
  144.  
  145. xadmaster.library/xadAddFileEntry           xadmaster.library/xadAddFileEntry
  146.  
  147.     NAME
  148.         xadAddFileEntry - Add file entry to list of entries (V10)
  149.  
  150.     SYNOPSIS
  151.         result = xadAddFileEntryA(fi, ai, tags)
  152.         D0                        A0  A1   A2
  153.  
  154.         LONG xadAddFileEntryA(struct xadFileInfo *, struct xadArchiveInfo *,
  155.              struct TagItem *)
  156.  
  157.         result = xadAddFileEntry(fi, ai, tag1, ...)
  158.  
  159.         LONG xadAddFileEntry(struct xadFileInfo *, struct xadArchiveInfo *,
  160.              Tag, ...)
  161.  
  162.     FUNCTION
  163.         This function adds a newly created struct xadFileInfo to the list of
  164.         entries and supports a hook call mechanism for user side interaction.
  165.         This should be used always instead of old-style selfmade lists.
  166.         Some important notes:
  167.         a) Never modify the lists yourself, if the two add-functions are used.
  168.         b) Use XADFIF_EXTRACTONBUILD, if the entry can be extracted during
  169.            this function call. Normally this requires the tag XAD_SETINPOS
  170.            also to get an determined file pointer afterwards.
  171.         c) An entry should be finished, when adding it to list. At least the
  172.            public information must be completed. Private information may be
  173.            added later (but this most time means XADFIF_EXTRACTONBUILD is
  174.            impossible).
  175.         d) Always check return code and react on it. This is necessary
  176.            especially to support XADERR_BREAK. In case XADERR_BREAK is
  177.            returned the work should be aborted in any case.
  178.  
  179.     INPUT
  180.         ai      - the master communication structure
  181.         fi      - the file info structure, which should be added to list
  182.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  183.                   XAD_SETINPOS, XAD_INSERTDIRSFIRST
  184.  
  185.     RESULT
  186.         result  - any of the XADERR codes or zero when all is ok.
  187.  
  188.     SEE ALSO
  189.         libraries/xadmaster.h, xadAddDiskEntry(), tags section
  190.  
  191. xadmaster.library/xadAllocObject             xadmaster.library/xadAllocObject
  192.  
  193.     NAME
  194.         xadAllocObject - Allocate memory for all xad related structures
  195.  
  196.     SYNOPSIS
  197.         ptr = xadAllocObjectA(type, tags)
  198.         D0                    D0    A0
  199.  
  200.         APTR xadAllocObjectA(ULONG, struct TagItem *)
  201.  
  202.         ptr = xadAllocObject(type, tag1, ...)
  203.  
  204.         APTR xadAllocObject(ULONG, Tag, ...)
  205.  
  206.     FUNCTION
  207.         This function allocates the memory of a needed xad related
  208.         structure and initializes it. You need to use this function to
  209.         allocate the structures. Any other way of allocating is not
  210.         allowed.
  211.     The structures are initialized, which means filled with zero in
  212.     nearly all cases. Fields allocated with XAD_OBJxxx are filled with
  213.     corresponding pointers and are cleared also. It is NOT necessary
  214.     to leave these pointers intact when calling xadFreeObject().
  215.  
  216.     INPUT
  217.         type    - in libraries/xadmaster.h defined XADOBJ_... types.
  218.                   For example XADOBJ_FILEINFO allocates xadFileInfo
  219.                   structure.
  220.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  221.                   XAD_OBJNAMESIZE, XAD_OBJCOMMENTSIZE, XAD_OBJBLOCKENTRIES,
  222.                   XAD_OBJPRIVINFOSIZE
  223.  
  224.     RESULT
  225.         ptr     - Pointer to required structure or 0 when an error occured.
  226.  
  227.     SEE ALSO
  228.         libraries/xadmaster.h, xadFreeObject(), tags section
  229.  
  230. xadmaster.library/xadAllocVec                   xadmaster.library/xadAllocVec
  231.  
  232.     NAME
  233.         xadAllocVec - Allocate memory for xad related stuff (V2)
  234.  
  235.     SYNOPSIS
  236.         ptr = xadAllocVec(size, flags)
  237.         D0                 D0     D1
  238.  
  239.         APTR xadAllocVec(ULONG, ULONG)
  240.  
  241.     FUNCTION
  242.         This function allocates memory for stuff related to xad. It is like
  243.         exec.library AllocVec() function, but uses xadFreeObject() to free
  244.         stuff and reduces the need for SysBase in clients. It's the prefered
  245.         method to allocate memory in clients.
  246.  
  247.     INPUT
  248.         size    - The size in bytes.
  249.         flags   - Normal MEMF_... flags defined in exec/types.h
  250.  
  251.     RESULT
  252.         ptr     - Pointer to required memory or 0 when an error occured.
  253.  
  254.     SEE ALSO
  255.         libraries/xadmaster.h, exec/types.h, exec.doc/AllocMem(),
  256.         xadFreeObject(),
  257.  
  258. xadmaster.library/xadCalcCRC16                 xadmaster.library/xadCalcCRC16
  259.  
  260.     NAME
  261.         xadCalcCRC16 - calculate a 16 bit CRC
  262.  
  263.     SYNOPSIS
  264.         crc16 = xadCalcCRC16(id, init, size, buffer)
  265.         D0                   D0   D1    D2     A0
  266.  
  267.         UWORD xadCalcCRC16(UWORD, UWORD, ULONG, STRPTR)
  268.  
  269.     FUNCTION
  270.         This function calculates a 16 bit CRC. It is possible to choose the
  271.         calculation method by parameter id.
  272.  
  273.         The CRC calculation uses a table built with following function:
  274.         void MakeCRC16(UWORD *buf, ULONG ID)
  275.         {
  276.           UWORD i, j, k;
  277.  
  278.           for(i = 0; i < 256; ++i)
  279.           {
  280.             k = i;
  281.  
  282.             for(j = 0; j < 8; ++j)
  283.             {
  284.               if(k & 1)
  285.                 k = (k >> 1) ^ ID;
  286.               else
  287.                 k >>= 1;
  288.             }
  289.             buf[i] = k;
  290.           }
  291.         }
  292.  
  293.         The used calculation routine is like that:
  294.         crc = init;
  295.         while(size--)
  296.           crc = tab[(crc ^ *buffer++) & 0xFF] ^ (crc >> 8);
  297.  
  298.         ID's defined in xadmaster.h use a default table. All others build the
  299.         table on the fly.
  300.         XADCRC16_ID1: (0xA001) - Used by DMS, Arc, ...
  301.  
  302.     INPUT
  303.         id      - The table creation ID (maybe XADCR16_ID value)
  304.         init    - The initial value for CRC calculation.
  305.         size    - The input buffer size.
  306.         buffer  - A pointer to the input buffer.
  307.  
  308.     RESULT
  309.         crc16   - The calculated CRC value.
  310.  
  311.     SEE ALSO
  312.         libraries/xadmaster.h, xadCalcCRC32
  313.  
  314. xadmaster.library/xadCalcCRC32                 xadmaster.library/xadCalcCRC32
  315.  
  316.     NAME
  317.         xadCalcCRC32 - calculate a 32 bit CRC
  318.  
  319.     SYNOPSIS
  320.         crc32 = xadCalcCRC32(id, init, size, buffer)
  321.         D0                   D0   D1    D2     A0
  322.  
  323.         ULONG xadCalcCRC32(ULONG, ULONG, ULONG, STRPTR)
  324.  
  325.     FUNCTION
  326.         This function calculates a 32 bit CRC. It is possible to choose the
  327.         calculation method by parameter id.
  328.  
  329.         The CRC calculation uses a table built with following function:
  330.         void MakeCRC32(ULONG *buf, ULONG ID)
  331.         {
  332.           ULONG i, j, k;
  333.  
  334.           for(i = 0; i < 256; ++i)
  335.           {
  336.             k = i;
  337.  
  338.             for(j = 0; j < 8; ++j)
  339.             {
  340.               if(k & 1)
  341.                 k = (k >> 1) ^ ID;
  342.               else
  343.                 k >>= 1;
  344.             }
  345.             buf[i] = k;
  346.           }
  347.         }
  348.  
  349.         The used calculation routine is like that:
  350.         crc = init;
  351.         while(size--)
  352.           crc = tab[(crc ^ *buffer++) & 0xFF] ^ (crc >> 8);
  353.  
  354.         ID's defined in xadmaster.h use a default table. All others build the
  355.         table on the fly.
  356.         XADCRC32_ID2: (0xEDB88320) - Used by Zoom, Zip, LZX, ...
  357.  
  358.     INPUT
  359.         id      - The table creation ID (maybe XADCR32_ID value)
  360.         init    - The initial value for CRC calculation.
  361.         size    - The input buffer size.
  362.         buffer  - A pointer to the input buffer.
  363.  
  364.     RESULT
  365.         crc32   - The calculated CRC value.
  366.  
  367.     SEE ALSO
  368.         libraries/xadmaster.h, xadCalcCRC16
  369.  
  370. xadmaster.library/xadConvertDates           xadmaster.library/xadConvertDates
  371.  
  372.     NAME
  373.         xadConvertDates - convert between date storage methods
  374.  
  375.     SYNOPSIS
  376.         result = xadConvertDatesA(tags)
  377.         D0                         A0
  378.  
  379.         LONG xadConvertDatesA(struct TagItem *)
  380.  
  381.         result = xadConvertDates(tag1, ...)
  382.  
  383.         LONG xadConvertDates(Tag, ...)
  384.  
  385.     FUNCTION
  386.         This function can be used to transform date and time between
  387.         different storage systems. One of the input tags must be specified.
  388.         Output tags may be specified multiple. The date information is
  389.         based on Gregorian calendar. Some systems can store a wider range
  390.         of dates than others. If a date produces an overflow or an
  391.         underflow for a special date, the highest/lowest valid date is used
  392.         (e.g. for timevalues 0x00000000 or 0xFFFFFFFF).
  393.  
  394.         The XAD_MAKEGMTDATE and XAD_MAKELOCALDATE tags need locale.library
  395.         to get the offset to local time. If locale.library cannot be opened
  396.         the offset is set to 0.
  397.  
  398.         XAD_DATECURRENTTIME can be used to get the current system date and
  399.         time.
  400.  
  401.         WeekDay information is ignored for input and always recalculated.
  402.         The calculation routines use full range of available variable space,
  403.         so f.e. a Unix date 1.1.1970 00:00:00 (value 0x00000000) with a
  404.         UTC offset of -30 min produces 31.12.1968 23:30:00 (which cannot be
  405.         stored as UNIX time value, but only as xadDate structure)!.
  406.  
  407.     INPUT
  408.         ai      - the master communication structure
  409.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  410.                   XAD_DATEUNIX, XAD_DATEAMIGA, XAD_DATEMAC, XAD_DATEDATESTAMP,
  411.                   XAD_DATEXADDATE, XAD_DATECLOCKDATA, XAD_DATECURRENTTIME,
  412.                   XAD_DATEMSDOS, XAD_GETDATEUNIX, XAD_GETDATEAMIGA,
  413.                   XAD_GETDATEDATESTAMP, XAD_GETDATEXADDATE,
  414.                   XAD_GETDATECLOCKDATA, XAD_GETDATEMSDOS, XAD_GETDATEMAC,
  415.                   XAD_MAKEGMTDATE, XAD_MAKELOCALDATE
  416.  
  417.     RESULT
  418.         result  - any of the XADERR codes or zero when all is ok.
  419.  
  420.     SEE ALSO
  421.         libraries/xadmaster.h, tags section
  422.  
  423. xadmaster.library/xadConvertProtection xadmaster.library/xadConvertProtection
  424.  
  425.     NAME
  426.         xadConvertProtection - convert between different protection bits (V4)
  427.  
  428.     SYNOPSIS
  429.         result = xadConvertProtectionA(tags)
  430.         D0                              A0
  431.  
  432.         LONG xadConvertProtectionA(struct TagItem *)
  433.  
  434.         result = xadConvertProtection(tag1, ...)
  435.  
  436.         LONG xadConvertProtection(Tag, ...)
  437.  
  438.     FUNCTION
  439.         This function can be used to transform protection bits of different
  440.         operating systems.
  441.  
  442.     The protection values are initialised with the Amiga standard values
  443.     "rwed". These bits are modified by specified XAD_PROTxxx tags, but
  444.     only the bits supported by that format (e.g. most systems do not
  445.     support "s" or "p"). You may specify multiple XAD_PROTxxx tags, if
  446.     a program stores them in different formats. As Amiga supports all
  447.     bits, it is necessary to specify XAD_PROTAMIGA as first argument in
  448.     such cases.
  449.  
  450.     The taglist must contain at least one of the XAD_GETPROTxxx tags.
  451.     Currently only XAD_GETPROTAMIGA is supported.
  452.  
  453.     The stored result is not affected by the position of the
  454.     XAD_GETPROTxxx tag in the list of tags! The result are always the
  455.     bits, which are computed of all input tags.
  456.  
  457.     INPUT
  458.         ai      - the master communication structure
  459.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  460.                   XAD_PROTAMIGA, XAD_PROTUNIX, XAD_PROTMSDOS,
  461.                   XAD_GETPROTAMIGA
  462.     RESULT
  463.         result  - any of the XADERR codes or zero when all is ok.
  464.  
  465.     SEE ALSO
  466.         libraries/xadmaster.h, tags section
  467.  
  468. xadmaster.library/xadCopyMem                     xadmaster.library/xadCopyMem
  469.  
  470.     NAME
  471.         xadCopyMem - copies one data block to another position (V2)
  472.  
  473.     SYNOPSIS
  474.         xadCopyMem(src, dest, size)
  475.                     A0   A1    D0
  476.  
  477.         void xadCopyMem(APTR, APTR, ULONG)
  478.  
  479.     FUNCTION
  480.         xadCopyMem is a general purpose memory copy function. It can deal
  481.         any length and its pointers on any alignment. It tries to optimize
  482.         the copy operation, when alignment and size allow longword copies.
  483.  
  484.         Overlapping copies are supported in both directions.
  485.  
  486.         The internal implementation of this function will change from
  487.         system to system and version to version.
  488.         This copy function is not highly optimized, but should fit any needs
  489.         around xadmaster.library!
  490.  
  491.     INPUT
  492.         src     - the source buffer
  493.         dest    - the destination buffer
  494.         size    - the size to copy
  495.  
  496.     RESULT
  497.         none
  498.  
  499.     SEE ALSO
  500.         libraries/xadmaster.h, exec.library/CopyMem()
  501.  
  502. xadmaster.library/xadDiskUnArc                 xadmaster.library/xadDiskUnArc
  503.  
  504.     NAME
  505.         xadDiskUnArc - the master function for unarchiving disks
  506.  
  507.     SYNOPSIS
  508.         result = xadDiskUnArcA(ai, tags)
  509.         D0                    A0   A1
  510.  
  511.         LONG xadDiskUnArcA(struct xadArchiveInfo *, struct TagItem *)
  512.  
  513.         result = xadDiskUnArc(ai, tag1, ...)
  514.  
  515.         LONG xadDiskUnArc(struct xadArchiveInfo *, Tag, ...)
  516.  
  517.     FUNCTION
  518.         This function dearchives a disk archive. It can be called after
  519.         a successful call to xadGetInfo(). At least the tag XAD_ENTRYNUMBER
  520.         and one of the output tags needs to be supplied. When a progress
  521.         hook is supplied, this can be used for questioning for overwriting
  522.         and ignoring of drive geometry and for status displays.
  523.         Normally disk archivers will have only one entry, but there may
  524.         be multiple disk archives.
  525.  
  526.         When this function returns, the supplied output data streams may
  527.         be used in any way (files, memory). The library does not even know
  528.         that they exist! The xadmaster.library cannot be used to rename,
  529.         protect, comment or delete that stuff!
  530.  
  531.     INPUT
  532.         ai      - the master communication structure
  533.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  534.           XAD_ENTRYNUMBER, XAD_HIGHCYLINDER, XAD_LOWCYLINDER,
  535.           output tags of xadGetHookAccess()
  536.  
  537.     RESULT
  538.         result  - any of the XADERR codes or zero when all is ok.
  539.  
  540.     SEE ALSO
  541.         libraries/xadmaster.h, xadFileUnArc(), xadGetInfo(),
  542.         xadGetHookAccess(), tags section
  543.  
  544. xadmaster.library/xadDiskFileUnArc         xadmaster.library/xadDiskFileUnArc
  545.  
  546.     NAME
  547.         xadDiskFileUnArc - for unarchiving files from disk image (V4)
  548.  
  549.     SYNOPSIS
  550.         result = xadDiskFileUnArcA(ai, tags)
  551.         D0                         A0   A1
  552.  
  553.         LONG xadDiskFileUnArcA(struct xadArchiveInfo *, struct TagItem *)
  554.  
  555.         result = xadDiskFileUnArc(ai, tag1, ...)
  556.  
  557.         LONG xadDiskFileUnArc(struct xadArchiveInfo *, Tag, ...)
  558.  
  559.     FUNCTION
  560.         This function extracts a file from disk images. It can be called
  561.         after a succesful call to xadGetDiskInfo(). At least the tag
  562.         XAD_ENTRYNUMBER and one of the output tags needs to be supplied.
  563.         When a progress hook is supplied, this can be used for questioning
  564.         for overwriting and for status displays.
  565.         This function needs to be called for every file, which should be
  566.         unarchived.
  567.  
  568.         When this function returns, the supplied output data streams may
  569.         be used in any way (files, memory). The library does not even know
  570.         that they exist! The xadmaster.library cannot be used to rename,
  571.         protect, comment or delete that stuff!
  572.  
  573.     INPUT
  574.         ai      - the master communication structure
  575.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  576.           XAD_ENTRYNUMBER, output tags of xadGetHookAccess()
  577.  
  578.     RESULT
  579.         result  - any of the XADERR codes or zero when all is ok.
  580.  
  581.     SEE ALSO
  582.         libraries/xadmaster.h, xadGetDiskInfo(), xadGetHookAccess(),
  583.         tags section
  584.  
  585. xadmaster.library/xadFileUnArc                 xadmaster.library/xadFileUnArc
  586.  
  587.     NAME
  588.         xadFileUnArc - the master function for unarchiving disks
  589.  
  590.     SYNOPSIS
  591.         result = xadFileUnArcA(ai, tags)
  592.         D0                    A0   A1
  593.  
  594.         LONG xadFileUnArcA(struct xadArchiveInfo *, struct TagItem *)
  595.  
  596.         result = xadFileUnArc(ai, tag1, ...)
  597.  
  598.         LONG xadFileUnArc(struct xadArchiveInfo *, Tag, ...)
  599.  
  600.     FUNCTION
  601.         This function dearchives a file archive entry. It can be called
  602.         after a succesful call to xadGetInfo(). At least the tag
  603.         XAD_ENTRYNUMBER and one of the output tags needs to be supplied.
  604.         When a progress hook is supplied, this can be used for questioning
  605.         for overwriting and for status displays.
  606.         This function needs to be called for every file, which should be
  607.         unarchived. Best is to do unarchiving in direction giving by
  608.         info structure, because some archivers crunch multiple files in one
  609.         pass and the unarchiver needs to compress and buffer the whole
  610.         pass to get one file.
  611.  
  612.         When this function returns, the supplied output data streams may
  613.         be used in any way (files, memory). The library does not even know
  614.         that they exist! The xadmaster.library cannot be used to rename,
  615.         protect, comment or delete that stuff!
  616.  
  617.     INPUT
  618.         ai      - the master communication structure
  619.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  620.           XAD_ENTRYNUMBER, output tags of xadGetHookAccess()
  621.  
  622.     RESULT
  623.         result  - any of the XADERR codes or zero when all is ok.
  624.  
  625.     SEE ALSO
  626.         libraries/xadmaster.h, xadDiskUnArc(), xadGetInfo(),
  627.         xadGetHookAcess(), tags section
  628.  
  629. xadmaster.library/xadFreeInfo                   xadmaster.library/xadFreeInfo
  630.  
  631.     NAME
  632.         xadFreeInfo - free stuff built and allocated with xadGetInfo()
  633.  
  634.     SYNOPSIS
  635.         xadFreeInfo(ai)
  636.                     A0
  637.  
  638.         void xadFreeInfo(struct xadArchiveInfo *)
  639.  
  640.     FUNCTION
  641.         Frees all the stuff built and allocated by a call to xadGetInfo() or
  642.         xadGetDiskInfo(). You always need to call this after your work with
  643.         a certain input file is finished.
  644.  
  645.     INPUTS
  646.         ai      - the master communication structure
  647.  
  648.     SEE ALSO
  649.         libraries/xadmaster.h, xadGetInfo(), xadGetDiskInfo()
  650.  
  651. xadmaster.library/xadFreeHookAccess       xadmaster.library/xadFreeHookAccess
  652.  
  653.     NAME
  654.         xadFreeHookAccess - free stuff allocated with xadGetHooAccess() (V8)
  655.  
  656.     SYNOPSIS
  657.         xadFreeHookAccessA(ai, tags)
  658.                           A0   A1
  659.  
  660.         void xadFreeHookAccessA(struct xadArchiveInfo *, struct TagItem *)
  661.  
  662.         xadFreeHookAccess(ai, tag1, ...)
  663.  
  664.         void xadFreeHookAccess(struct xadArchiveInfo *, Tag, ...)
  665.  
  666.     FUNCTION
  667.         Frees all the stuff built and allocated by a call to xadGetHookAccess().
  668.         You always need to call this after your work with the hooks is finished.
  669.  
  670.     INPUTS
  671.         ai      - the master communication structure
  672.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  673.                   XAD_WASERROR
  674.  
  675.     SEE ALSO
  676.         libraries/xadmaster.h, xadGetHookAccess()
  677.  
  678. xadmaster.library/xadFreeObject               xadmaster.library/xadFreeObject
  679.  
  680.     NAME
  681.         xadFreeObject - Frees structures allocated with xadAllocObject() or
  682.                         xadAllocVec()
  683.  
  684.     SYNOPSIS
  685.         xadFreeObjectA(object, tags)
  686.                          A0      A1
  687.  
  688.         void xadFreeObjectA(APTR, struct TagItem *)
  689.  
  690.         xadFreeObject(object, tag1, ...)
  691.  
  692.         void xadFreeObject(APTR, Tag, ...)
  693.  
  694.     FUNCTION
  695.         Frees object allocated by xadAllocObject() or xadAllocVec(). Do not call
  696.         for objects allocated in any other way.
  697.         This function frees ALL memory which was allocated by xadAllocObject(),
  698.         but only this memory. This means all name buffers and other related
  699.         structures are freed, but if you replace pointers, your replacements
  700.         get not freed. This function does not need the original pointers to be
  701.         in the related positions, as the buffer size is stored elsewhere.
  702.  
  703.     INPUTS
  704.         object  - object allocated with xadAllocObject() or xadAllocVec()
  705.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  706.                   currently none
  707.  
  708.     SEE ALSO
  709.         libraries/xadmaster.h, xadAllocObject(), xadAllocVec(), tags section
  710.  
  711. xadmaster.library/xadGetClientInfo         xadmaster.library/xadGetClientInfo
  712.  
  713.     NAME
  714.         xadGetClientInfo - Get list of active clients
  715.  
  716.     SYNOPSIS
  717.         ptr = xadGetClientInfo()
  718.         D0
  719.  
  720.         struct xadClient *xadGetClientInfo(void)
  721.  
  722.     FUNCTION
  723.         This function returns a list of all active clients. It can be used
  724.         to show information about the library. The list is read only and
  725.         cannot be modified!
  726.  
  727.     RESULT
  728.         ptr     - Pointer to first client in the list.
  729.  
  730.     SEE ALSO
  731.         libraries/xadmaster.h
  732.  
  733. xadmaster.library/xadGetDiskInfo             xadmaster.library/xadGetDiskInfo
  734.  
  735.     NAME
  736.         xadGetDiskInfo - get information about files from disk image (V4)
  737.  
  738.     SYNOPSIS
  739.         result = xadGetDiskInfoA(ai, tags)
  740.         D0                       A0   A1
  741.  
  742.         LONG xadGetDiskInfoA(struct xadArchiveInfo *, struct TagItem *)
  743.  
  744.         result = xadGetDiskInfo(ai, tag1, ...)
  745.  
  746.         LONG xadGetDiskInfo(struct xadArchiveInfo *, Tag, ...)
  747.  
  748.     FUNCTION
  749.         This function returns all useful information about a specified
  750.         disk image filesytem structure. The information about files,
  751.         directories and links are stored in xai_FileInfo list. You may
  752.         call xadDiskFileUnArc() to extract files from the disk image.
  753.  
  754.         The data must be freed by a call to xadFreeInfo(). After that the
  755.         xadArchiveInfo structure must be freed and NEVER be used again!
  756.  
  757.         The supplied input stream is used and must be valid and unmodified
  758.         until xadFreeInfo() is called. Only the master functions are allowed
  759.         to access the stream, but it is guaranteed to be unmodified!
  760.  
  761.     INPUT
  762.         ai      - the master communication structure
  763.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  764.           XAD_STARTCLIENT, XAD_NOEMPTYERROR, XAD_NOEXTERN,
  765.           input tags of xadGetHookAccess()
  766.  
  767.     RESULT
  768.         result  - any of the XADERR codes or zero when all is ok.
  769.  
  770.     SEE ALSO
  771.         libraries/xadmaster.h, xadFreeInfo(), xadDiskFileUnArc(),
  772.         xadGetInfo(), xadGetHookAccess(), tags section
  773.  
  774. xadmaster.library/xadGetErrorText           xadmaster.library/xadGetErrorText
  775.  
  776.     NAME
  777.         xadGetErrorText - Get error string from an error number
  778.  
  779.     SYNOPSIS
  780.         ptr = xadGetErrorText(errnum)
  781.         D0                    D0
  782.  
  783.         STRPTR xadGetErrorText(ULONG)
  784.  
  785.     FUNCTION
  786.         This function returns the error string related to the supplied
  787.         error number. This string is valid as long as xadmaster.library
  788.         is opened, so when needed any longer time it must be copied.
  789.  
  790.     INPUT
  791.         errnum  - in libraries/xadmaster.h defined XADERR_... numbers.
  792.  
  793.     RESULT
  794.         ptr     - Pointer to required string.
  795.  
  796.     SEE ALSO
  797.         libraries/xadmaster.h
  798.  
  799. xadmaster.library/xadGetInfo                     xadmaster.library/xadGetInfo
  800.  
  801.     NAME
  802.         xadGetInfo - get information about an archive
  803.  
  804.     SYNOPSIS
  805.         result = xadGetInfoA(ai, tags)
  806.         D0                   A0   A1
  807.  
  808.         LONG xadGetInfoA(struct xadArchiveInfo *, struct TagItem *)
  809.  
  810.         result = xadGetInfo(ai, tag1, ...)
  811.  
  812.         LONG xadGetInfo(struct xadArchiveInfo *, Tag, ...)
  813.  
  814.     FUNCTION
  815.         This function returns all useful information about a specified
  816.         archive. It opens the archive for working. You may call
  817.         xadFileUnArc() or xadDiskUnArc() for the included entries
  818.         after a successful call to xadGetInfo(). The data must be freed
  819.         by a call to xadFreeInfo(). After that the xadArchiveInfo structure
  820.         must be freed and NEVER be used again! For archives encrypting
  821.         the information parts as well, you need to specify XAD_PASSWORD.
  822.         This password can be used for all calls to a unarchiving function,
  823.         but is overwritten by XAD_PASSWORD tag argument (only for the
  824.         entry with XAD_PASSWORD specified). Check and parse the elements
  825.         xai_FileInfo and xai_DiskInfo. You may expect both lists to have
  826.         valid entries or also both to be empty. Parsing the lists is the
  827.         normal way to do anything.
  828.  
  829.         The supplied input stream is used and must be valid and unmodified
  830.         until xadFreeInfo() is called. Only the current client is allowed to
  831.         access the stream, but it is guaranteed to be unmodified!
  832.  
  833.     INPUT
  834.         ai      - the master communication structure
  835.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  836.           XAD_NOEXTERN, input tags of xadGetHookAccess()
  837.  
  838.     RESULT
  839.         result  - any of the XADERR codes or zero when all is ok.
  840.  
  841.     SEE ALSO
  842.         libraries/xadmaster.h, xadFreeInfo(), xadDiskUnArc(),
  843.         xadFileUnArc(), xadGetHookAccess(), tags section
  844.  
  845. xadmaster.library/xadGetHookAccess         xadmaster.library/xadGetHookAccess
  846.  
  847.     NAME
  848.         xadGetHookAccess - initialize input and output hooks
  849.  
  850.     SYNOPSIS
  851.         result = xadGetHookAccessA(ai, tags)
  852.         D0                         A0   A1
  853.  
  854.         LONG xadGetHookAccessA(struct xadArchiveInfo *, struct TagItem *)
  855.  
  856.         result = xadGetHookAccess(ai, tag1, ...)
  857.  
  858.         LONG xadGetHookAccess(struct xadArchiveInfo *, Tag, ...)
  859.  
  860.     FUNCTION
  861.         This function opens input and output hooks. The data must be freed
  862.         by a call to xadFreeHookAccess(). After that the xadArchiveInfo
  863.         structure must be freed and NEVER be used again!
  864.  
  865.         The supplied input and output streams are used and must be valid
  866.         and unmodified until xadFreeHookAccess() is called. Only the
  867.         current client is allowed to access the streams, but the input
  868.         stream is guaranteed to be unmodified!
  869.  
  870.     You may use xadHookAccess() and xadHookTagAccess() to access the
  871.     streams.
  872.  
  873.     INPUT
  874.         ai      - the master communication structure
  875.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  876.                   XAD_INSIZE, XAD_INFILENAME, XAD_INFILEHANDLE,
  877.                   XAD_INMEMORY, XAD_INHOOK, XAD_INSPLITTED, 
  878.                   XAD_INXADSTREAM, XAD_INDISKARCHIVE,
  879.           XAD_OUTFILEHANDLE, XAD_OUTFILENAME, XAD_OUTHOOK,
  880.           XAD_OUTMEMORY, XAD_OUTSIZE, XAD_OUTXADSTREAM,
  881.           XAD_OUTDEVICE,
  882.           XAD_PROGRESSHOOK, XAD_VERIFY, XAD_FORMAT,
  883.           XAD_OVERWRITE, XAD_MAKEDIRECTORY, XAD_NOKILLPARTIAL,
  884.           XAD_IGNOREGEOMETRY, XAD_USESECTORLABELS,
  885.           XAD_PASSWORD
  886.  
  887.     RESULT
  888.         result  - any of the XADERR codes or zero when all is ok.
  889.  
  890.     SEE ALSO
  891.         libraries/xadmaster.h, xadFreeHookAccess(), xadHookAccess(),
  892.         xadHookTagAccess(), tags section
  893.  
  894. xadmaster.library/xadHookAccess               xadmaster.library/xadHookAccess
  895.  
  896.     NAME
  897.         xadHookAccess - a client only function to get/store data
  898.  
  899.     SYNOPSIS
  900.         result = xadHookAccess(command, data, buffer, ai)
  901.         D0                       D0      D1     A0    A1
  902.  
  903.         LONG xadHookAccess(ULONG, LONG, APTR, struct xadArchiveInfo *)
  904.  
  905.     FUNCTION
  906.         This function is for external clients only. It is needed to get
  907.         data, store results and seek in input or output. There are 5
  908.         commands XADAC_READ, XADAC_WRITE, XADAC_COPY, XADAC_INPUTSEEK,
  909.         XADAC_OUTPUTSEEK to do that. This function updates the xai_InPos,
  910.         xai_OutPos and xai_OutSize fields in xadArchiveInfo structure. The
  911.         seek commands and the copy command should set buffer parameter to
  912.         zero. Seek's and reads should not exceed the file borders! The
  913.         client knows position and size, so checks are possible before doing
  914.         wrong commands.
  915.  
  916.         See also xadHookTagAccess() function, which allows to pass tags for
  917.         deeper control, which is necessary sometimes.
  918.  
  919.     INPUT
  920.         command - one of the XADAC commands to control hook
  921.         data    - the required data, mostly a size value
  922.         buffer  - the input/output buffer for read and write
  923.         ai      - the master communication structure
  924.  
  925.     RESULT
  926.         result  - any of the XADERR codes or zero when all is ok.
  927.  
  928.     SEE ALSO
  929.         libraries/xadmaster.h, xadHookTagAccess()
  930.  
  931. xadmaster.library/xadHookTagAccess         xadmaster.library/xadHookTagAccess
  932.  
  933.     NAME
  934.         xadHookTagAccess - a client only function to get/store data (V3)
  935.  
  936.     SYNOPSIS
  937.         result = xadHookTagAccessA(command, data, buffer, ai, tags)
  938.         D0                           D0      D1     A0    A1   A2
  939.  
  940.         LONG xadHookTagAccessA(ULONG, LONG, APTR, struct xadArchiveInfo *,
  941.              struct TagItem *)
  942.  
  943.         result = xadHookTagAccess(command, data, buffer, ai, tag1, ...)
  944.  
  945.         LONG xadHookTagAccess(ULONG, LONG, APTR, struct xadArchiveInfo *,
  946.              Tag, ...)
  947.  
  948.     FUNCTION
  949.         This function equals xadHookAccess() but allows to use tags to get
  950.         better control. This includes CRC creation and use of xadSkipInfo
  951.         system.
  952.  
  953.     INPUT
  954.         command - one of the XADAC commands to control hook
  955.         data    - the required data, mostly a size value
  956.         buffer  - the input/output buffer for read and write
  957.         ai      - the master communication structure
  958.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  959.                   XAD_CRC16ID, XAD_CRC32ID, XAD_GETCRC16, XAD_GETCRC32,
  960.                   XAD_USESKIPINFO, XAD_SECTORLABELS
  961.  
  962.     RESULT
  963.         result  - any of the XADERR codes or zero when all is ok.
  964.  
  965.     SEE ALSO
  966.         libraries/xadmaster.h, xadHookAccess(), tags section
  967.  
  968. xadmaster.library/xadRecogFile                 xadmaster.library/xadRecogFile
  969.  
  970.     NAME
  971.         xadRecogFile - check if a file is an archive file or not
  972.  
  973.     SYNOPSIS
  974.         client = xadRecogFileA(size, memory, tags)
  975.         D0                     D0     A0     A1
  976.  
  977.         struct xadClient *xadRecogFileA(ULONG, APTR, struct TagItem *)
  978.  
  979.         client = xadRecogFile(size, memory, tag1, ...)
  980.  
  981.         struct xadClient *xadRecogFile(ULONG, APTR, Tag, ...)
  982.  
  983.     FUNCTION
  984.         This function can be used to check if a file is a archive or not.
  985.         It has only limited abilities! You need to pass a pointer to
  986.         memory of recogsize. The recogsize value can be found in
  987.         xadMasterBase. If the file is shorter, use the complete file as
  988.         buffer. Longer buffers are allowed as well. When the file is
  989.         archived, you get back a pointer to the client which detected the
  990.         file. If not, the return is zero. The only usable information
  991.         should be the name of the client. To get more information and all
  992.         archive related data you have to use xadGetInfo(), which calls
  993.         xadRecogFile internal itself.
  994.  
  995.         Normally this function is not needed by application programs. It
  996.         is used in xadList utility. This function is useful for tools
  997.         only detecting and displaying the archiver type.
  998.  
  999.     INPUT
  1000.         size    - size of the memory region
  1001.         memory  - pointer to the memory holding the file
  1002.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  1003.                   XAD_NOEXTERN
  1004.  
  1005.     RESULT
  1006.         client  - pointer to client structure or zero when no archive
  1007.  
  1008.     SEE ALSO
  1009.         libraries/xadmaster.h, xadGetInfo(), tags section
  1010.  
  1011. xadmaster.library/--tags--                         xadmaster.library/--tags--
  1012.  
  1013.     TAGS FOR xadAllocObject()
  1014.  
  1015.       XAD_OBJBLOCKENTRIES       (ULONG)
  1016.         Can be specified together with XADOBJ_DISKINFO. This allocates
  1017.         memory for xdi_BlockInfo. Data field of tag item contains number
  1018.         of required blocks. Memory gets freed automatically, when object
  1019.         is freed.
  1020.  
  1021.       XAD_OBJCOMMENTSIZE        (ULONG)
  1022.         Like XAD_OBJNAMESIZE, but allocates memory for xfi_Comment entry.
  1023.  
  1024.       XAD_OBJNAMESIZE           (ULONG)
  1025.         Can be specified together with XADOBJ_FILEINFO. This allocates
  1026.         memory for storing file name. The required size has to be stored
  1027.         in data field of tag item. The allocated memory pointer is stored
  1028.         in xfi_FileName field of returned structure. Memory gets freed
  1029.         automatically, when object is freed.
  1030.  
  1031.       XAD_OBJPRIVINFOSIZE       (ULONG)
  1032.         Can be specified together with XADOBJ_FILEINFO and XADOBJ_DISKINFO.
  1033.         This allocates longword aligned client private buffer, which is
  1034.         stored in xfi_PrivateInfo or xdi_PrivateInfo field. The required
  1035.         size has to be stored in data field of tag item. Memory gets freed
  1036.         automatically, when object is freed.
  1037.  
  1038.     INPUT TAGS FOR xadGetHookAccess()
  1039.  
  1040.       XAD_INDISKARCHIVE        (struct TagItem *) (V4)
  1041.     This hook allows to supply a disk archive as input source for
  1042.     file extraction from disk image files. You need to pass a
  1043.     pointer to a tagitem list (finished with TAG_DONE!) as data.
  1044.     This list is passed to xadGetInfo(). It may contain any of the
  1045.     tags supported by that function and must contain any of the
  1046.     input hook tags! Additionally it may contain XAD_ENTRYNUMBER
  1047.     to specify the entry, which should be used! If not, the first
  1048.     entry is used!
  1049.  
  1050.       XAD_INFILEHANDLE          (BPTR)
  1051.         FileHandle to get data from. It is not necessary that the handle
  1052.         is at the beginning of the file.
  1053.  
  1054.       XAD_INFILENAME            (STRPTR)
  1055.         Name of the input file.
  1056.  
  1057.       XAD_INHOOK                (struct Hook *)
  1058.         This enables any other way of data delivering. See special
  1059.         chapter on I/O hook functions.
  1060.  
  1061.       XAD_INMEMORY              (STRPTR)
  1062.         Pointer to a memory buffer holding the input data. You need to
  1063.         specify XAD_INSIZE when using this.
  1064.  
  1065.       XAD_INSIZE                (ULONG)
  1066.         Specify the size of input data. Must be used together with
  1067.         XAD_INMEMORY. Can be used together with other hooks.
  1068.  
  1069.       XAD_INSPLITTED            (struct xadSplitFile *) (V2)
  1070.         For multivolume archives it is necessary to supply multiple files.
  1071.         This tag allows to pass multiple input streams of any type in a
  1072.         linked list of xadSplitFile structures. The clients see that as
  1073.         one single continous stream (except that ai->xai_MultiVolume
  1074.         contains a field with size information for every part).
  1075.         Each entry must contain one of the other input types and the
  1076.         corresponding data. Also the size can be or must be (XAD_INMEMORY)
  1077.         passed in xadSplitFile structure.
  1078.         Clients could expect the parts in it correct order, but should be
  1079.         able to handle missing or corrupted part.
  1080.  
  1081.       XAD_INXADSTREAM        (struct TagItem *) (V8)
  1082.     This allows to use an already existing XAD data stream as input for
  1083.     new calls. Can be used from clients to work with embedded archives
  1084.     in other archives. Do not touch the data yourself with
  1085.     xadHookAccess() until you released the secondary use with 
  1086.     xadFreeInfo()! At least XAD_ARCHIVEINFO must be supplied. Other tags
  1087.     of xadHookTagAccess() are supported as well. CRC-Pointers must be
  1088.     valid until xadFreeInfo()!
  1089.  
  1090.     OUTPUT TAGS FOR xadGetHookAccess()
  1091.  
  1092.       XAD_IGNOREGEOMETRY        (BOOL)
  1093.         This forces the device hook to use devices with different drive
  1094.         geometry than the one on disk archive. Most time this will produce
  1095.         useless disks. If not set the progress hook may get asked if
  1096.         geometry should be ignored or not (if there is one).
  1097.  
  1098.       XAD_FORMAT                (BOOL) (V5)
  1099.         Turns on formating of output device. This is turned off by default.
  1100.  
  1101.       XAD_MAKEDIRECTORY         (BOOL)
  1102.         Create missing directory tree when necessary. If not set the
  1103.         progress hook may get asked if directory should be created or
  1104.         not (if there is one).
  1105.  
  1106.       XAD_NOKILLPARTIAL        (BOOL) (V3.3)
  1107.     If this is set to true, partial or corrupted files get not deleted.
  1108.     This has effect only for file output hook and only if the filename
  1109.     was passed (and not the FileHandle pointer).
  1110.  
  1111.       XAD_OUTDEVICE             (struct xadDeviceInfo *)
  1112.         For disk archives it is useful to store data directly on a disk.
  1113.         Use this tag to specify the device where data should be stored.
  1114.         In xdi_DOSName the DOS device must be stored, which must not be
  1115.         terminated with a ':' character.
  1116.         Alternatively in fields xdi_DeviceName and xdi_Unit the wanted
  1117.         device must be specified. The device must support TD_GETGEOMETRY
  1118.         command, even if XAD_IGNOREGEOMETRY is turned on, as the hook
  1119.         needs at least the blocksize for internal buffering.
  1120.         NOTE: When xdi_DeviceName and xdi_Unit is used, the hook cannot
  1121.         perform an Inhibit operation and thus it cannot prevent other
  1122.         tasks from accessing the device. Also a DOS device is not updated,
  1123.         so a DiskChange becomes necessary.
  1124.         I suggest always using xdi_DOSName field!
  1125.       
  1126.       XAD_OUTFILEHANDLE         (BPTR)
  1127.         FileHandle to send data to. It is not necessary that the handle
  1128.         is at the beginning of the file.
  1129.  
  1130.       XAD_OUTFILENAME           (STRPTR)
  1131.         Name of the output file.
  1132.  
  1133.       XAD_OUTHOOK               (struct Hook *)
  1134.         This enables any other way of data storing. See special chapter
  1135.         on I/O hook functions.
  1136.  
  1137.       XAD_OUTMEMORY             (STRPTR)
  1138.         Pointer to a memory buffer to store data in. You need to specify
  1139.         XAD_OUTSIZE when using this.
  1140.  
  1141.       XAD_OUTSIZE               (ULONG)
  1142.         Specify the maximum size of output data. Must be used together with
  1143.         XAD_OUTMEMORY.
  1144.  
  1145.       XAD_OUTXADSTREAM        (struct TagItem *) (V8)
  1146.     This allows to use an already existing XAD data stream as output for
  1147.     new calls. Can be used from clients to work with embedded archives
  1148.     in other archives. Do not touch the data yourself with
  1149.     xadHookAccess() until you released the secondary use with 
  1150.     xadFreeInfo()! At least XAD_ARCHIVEINFO must be supplied. Other tags
  1151.     of xadHookTagAccess() are supported as well. 
  1152.  
  1153.       XAD_OVERWRITE             (BOOL)
  1154.         This forces the file hook to overwrite existing destination files.
  1155.         If not set the progress hook may get asked if files should be
  1156.         overwritten or not (if there is one).
  1157.  
  1158.       XAD_PROGRESSHOOK          (struct Hook *)
  1159.         The progress hook for status displays. See special progress hook
  1160.         chapter for more information. Starting with V10 the progress hook
  1161.         is used during list creation also (if client supports this).
  1162.  
  1163.       XAD_USESECTORLABELS    (BOOL) (V9)
  1164.     This turns on the storage of sector labels for disk hook. This means
  1165.     also CMD_WRITE is replaced by trackdisk.device command ETD_WRITE,
  1166.     which may not be supported by all device drivers. This is turned off
  1167.     by default.
  1168.  
  1169.       XAD_VERIFY                (BOOL)
  1170.         Turns on verify for device output. This is turned off by default.
  1171.  
  1172.     TAGS FOR xadConvertDates()
  1173.  
  1174.       XAD_DATEUNIX              (ULONG)
  1175.         Input is an UNIX date value (seconds starting with 01.01.1970).
  1176.  
  1177.       XAD_DATEAMIGA             (ULONG)
  1178.         Input as an Amiga date value (seconds starting with 01.01.1978).
  1179.  
  1180.       XAD_DATEDATESTAMP         (struct DateStamp *)
  1181.         Input is a pointer to an Amiga DateStamp structure.
  1182.     struct DateStamp
  1183.     {
  1184.       LONG     ds_Days;   /* Number of days since 01.01.1978 */
  1185.       LONG     ds_Minute; /* Number of minutes past midnight */
  1186.       LONG     ds_Tick;   /* Number of ticks (50 per sec) past minute */
  1187.     };
  1188.  
  1189.       XAD_DATEXADDATE           (struct xadDate *)
  1190.         Input is a pointer to a xadmaster date structure.
  1191.  
  1192.       XAD_DATECLOCKDATA         (struct ClockData *)
  1193.         Input is a pointer to a ClockData structure.
  1194.     struct ClockData
  1195.     {
  1196.       UWORD sec;
  1197.       UWORD min;
  1198.       UWORD hour;
  1199.       UWORD mday;
  1200.       UWORD month;
  1201.       UWORD year;
  1202.       UWORD wday;
  1203.     };
  1204.  
  1205.       XAD_DATECURRENTTIME       (void)
  1206.         Current system time value should be used as input.
  1207.  
  1208.       XAD_DATECPM        (UBYTE[5]) (V10)
  1209.     Input is an CP/M date field:
  1210.         UWORD   day     ;days starting with 01.01.1978 (==1), Intel byte order
  1211.         UBYTE   hour    ;Packed BCD
  1212.         UBYTE   minute  ;Packed BCD
  1213.         UBYTE   second  ;Packed BCD
  1214.  
  1215.       XAD_DATECPM2        (ULONG) (V10)
  1216.     Input is an CP/M date field:
  1217.         Bit 0..4 is half second (25 = second 49 or 50), 5..10 is minute,
  1218.         11..15 is hour,16..31 is days starting with 01.01.1978 (==1).
  1219.  
  1220.       XAD_DATEMAC               (ULONG) (V8)
  1221.         Input as an MacIntosh date value (seconds starting with 01.01.1904).
  1222.  
  1223.       XAD_DATEMSDOS             (ULONG) (V2)
  1224.         Input is an 32 bit packed date format used by MS-DOS. This means:
  1225.         Bit 0..4 is half second (25 = second 49 or 50), 5..10 is minute,
  1226.         11..15 is hour, 16..20 is day, 21..24 is month (1 = january) and
  1227.         25..31 is year (0 = year 1980). This format is used for archivers
  1228.         like RAR or Zip.
  1229.  
  1230.       XAD_GETDATEUNIX           (ULONG *)
  1231.         An UNIX time value should be stored in the ULONG variable, the
  1232.         supplied pointer points to.
  1233.  
  1234.       XAD_GETDATEAMIGA          (ULONG *)
  1235.         An Amiga time value should be stored in the ULONG variable, the
  1236.         supplied pointer points to.
  1237.  
  1238.       XAD_GETDATEDATESTAMP      (struct DateStamp *)
  1239.         The date should be stored in DateStamp structure the supplied
  1240.         pointer points to.
  1241.  
  1242.       XAD_GETDATEXADDATE        (struct xadDate *)
  1243.         The date should be stored in xadmaster date structure the supplied
  1244.         pointer points to.
  1245.  
  1246.       XAD_GETDATECLOCKDATA      (struct ClockData *)
  1247.         The date should be stored in ClockData structure the supplied
  1248.         pointer points to.
  1249.  
  1250.       XAD_GETDATECPM        (UBYTE[5]) (V10)
  1251.     The CP/M date is stored in the buffer pointer to by supplied pointer.
  1252.  
  1253.       XAD_GETDATECPM2           (ULONG *) (V10)
  1254.         The CP/M packed date should be stored in the ULONG variable, the
  1255.         supplied pointer points to.
  1256.  
  1257.       XAD_GETDATEMAC            (ULONG *) (V8)
  1258.         An MacIntosh time value should be stored in the ULONG variable, the
  1259.         supplied pointer points to.
  1260.  
  1261.       XAD_GETDATEMSDOS          (ULONG *) (V2)
  1262.         An MS-DOS packed date value should be stored in the ULONG variable,
  1263.         the supplied pointer points to.
  1264.  
  1265.       XAD_MAKEGMTDATE           (BOOL)
  1266.         This forces the function to subtract the GMT offset supplied by
  1267.         locale.library to convert a local date to GMT date. Opening
  1268.         locale.library is required for that. When it cannot be openend or
  1269.         the offset would cause a overrun or underrun in the xd_Year field,
  1270.         no offset will be used. 
  1271.       
  1272.       XAD_MAKELOCALDATE         (BOOL)
  1273.         This forces the function to add the GMT offset supplied by
  1274.         locale.library to convert a GMT date to a local date. Opening
  1275.         locale.library is required for that. When it cannot be openend or
  1276.         the offset would cause a overrun or underrun in the xd_Year field,
  1277.         no offset will be used.
  1278.  
  1279.     TAGS FOR xadHookTagAccess() (V3)
  1280.  
  1281.       XAD_CRC16ID               (UWORD)
  1282.         This tag specifies the CRC-ID, which should be used for CRC16
  1283.         calculation. The default value is XADCRC16_ID1.
  1284.  
  1285.       XAD_CRC32ID               (ULONG)
  1286.         This tag specifies the CRC-ID, which should be used for CRC32
  1287.         calculation. The default value is XADCRC32_ID1.
  1288.  
  1289.       XAD_GETCRC16              (UWORD *)
  1290.         A pointer to a UWORD variable holding the CRC start value and after
  1291.         calling xadHookTagAccess() the final CRC value. CRC checks are done
  1292.         for XADAC_COPY, XADAC_READ and XADAC_WRITE.
  1293.  
  1294.       XAD_GETCRC32              (ULONG *)
  1295.         Like XAD_GETCRC16, but for 32 bit checksums.
  1296.  
  1297.       XAD_SECTORLABLES        (APTR) (V9)
  1298.     This tag allows to pass sector label information with XADAC_WRITE.
  1299.     There are some restrictions when passing them. First the data size
  1300.     must be a multiple of 512 and second the number of sector labels
  1301.     must match the number of 512 byte blocks. A sector label has the
  1302.     size of 16 byte! When e.g. passing a normal disk cylinder with
  1303.     11*2*512 byte (11264 byte), you need to pass a block to 11*2*16 byte
  1304.     (352 byte) with this tag. The sector labels are passed in one block
  1305.     always.
  1306.  
  1307.       XAD_USESKIPINFO           (BOOL)
  1308.         The field xadSkipInfo of xadArchiveInfo structure is used to skip
  1309.         parts of the input stream for read, copy and input seek operations.
  1310.         Whenever this tag is used, then the contents of the xai_SkipInfo
  1311.         field is interpreted.
  1312.         The data parts specified in the list are skipped for read and seek
  1313.         operations, so that you get always continous data blocks. It does
  1314.         not ignore them totally, so file sizes and file position are not
  1315.         changed. So if you read 500 bytes and there is a 8 byte skip block
  1316.         in between, then file position increases by 508 byte, but you get
  1317.         500 byte data without the skipped data.
  1318.  
  1319.         xadSkipInfo information only affects operations in input stream!
  1320.  
  1321.         The entries of xadSkipInfo list must not overlap and there must be
  1322.         at least one byte between entries!
  1323.  
  1324.     TAGS FOR xadConvertProtection() (V4)
  1325.  
  1326.       XAD_GETPROTAMIGA        (ULONG *)
  1327.     This tag is used to get the computed protection bits in Amiga format
  1328.     including the multiuser bits. These can be store in xadFileInfo
  1329.     structure.
  1330.  
  1331.       XAD_PROTAMIGA        (ULONG)
  1332.     Input bits of Amiga style. This tag is useful together with other
  1333.     tags only. Archives containing Amiga protection without multiuser
  1334.     bits and Unix bits may be converted this way: "XAD_PROTAMIGA,
  1335.     amigabits, XAD_PROTUNIX, unixbits, XAD_GETPROTAMIGA, &amigabits".
  1336.     Now the multiuser bits are inluded.
  1337.     Specifying this tag always resets calculation! It may be used to
  1338.     reset the default bits as well. Specifying and XAD_PROTxxx tags
  1339.     in front of this one is really useless.
  1340.  
  1341.       XAD_PROTMSDOS        (ULONG)
  1342.     Input bits of MSDOS style: 0 = read only, 1 = hidden, 2 = system,
  1343.     3 = volumename, 4 = directory, 5 = archived
  1344.     Only "r,w,a,d" bits of Amiga style are affected.
  1345.  
  1346.       XAD_PROTUNIX        (ULONG)
  1347.     Input bits of UNIX style: 0 = other execute, 1 = other write,
  1348.     2 = other read, 3 = group execute, 4 = group write, 5 = group read,
  1349.     6 = execute, 7 = write, 8 = read
  1350.     This affects the "r,w,e" and the multiuser bits of Amiga style.
  1351.  
  1352.     TAGS FOR different functions
  1353.  
  1354.       XAD_ARCHIVEINFO        (struct xadArchiveInfo *) (V8)
  1355.     This must be used to supply archive info with XAD_OUTXADSTREAM and
  1356.     XAD_INXADSTREAM.
  1357.  
  1358.       XAD_ENTRYNUMBER           (ULONG)
  1359.         This flag specifies the wanted entry. You must not specify more
  1360.         or less than one of that flag for every call to xadFileUnArc(),
  1361.         xadDiskFileUnArc() or xadDiskUnArc(). Normally this flag equals
  1362.         the element xdi_EntryNumber for currently parsed xadDiskInfo
  1363.         structure and xfi_EntryNumber for currently parsed xadFileInfo
  1364.         structure. The only assumption about entry numbers is, that they
  1365.         are unique! The entries must not be in any order, when parsed.
  1366.  
  1367.       XAD_HIGHCYLINDER          (ULONG)
  1368.         It specifies the highest cylinder which should be unarchived for
  1369.         xadDiskUnArc().
  1370.  
  1371.       XAD_INSERTDIRSFIRST    (BOOL) (V10)
  1372.     This tag can be used with xadAddFileEntry() and changes the
  1373.     behaviour, so that directory entries are alphabetically inserted
  1374.     at list start.
  1375.  
  1376.       XAD_LOWCYLINDER           (ULONG)
  1377.         It specifies the lowest cylinder which should be unarchived for
  1378.         xadDiskUnArc().
  1379.  
  1380.       XAD_NOEMPTYERROR        (BOOL) (V8)
  1381.     This one prevents production of XADERR_EMPTY, but instead
  1382.     xadGetDiskInfo() returns the empty file list. This is very useful
  1383.     together with XAD_STARTCLIENT tag.
  1384.  
  1385.       XAD_NOEXTERN              (BOOL)
  1386.         When this is specified for xadGetInfo(), xadGetDiskInfo() or
  1387.         xadRecogFile(), the library skips any external clients. Normally
  1388.         this should not be necessary. Some of the main clients are
  1389.         external as well (for legal reasons).
  1390.  
  1391.       XAD_PASSWORD              (STRPTR)
  1392.         You may supply a password for xadGetHookAccess() and related
  1393.         functions.
  1394.  
  1395.       XAD_SETINPOS        (ULONG) (V10)
  1396.     This may be used with xadAddFileEntry() and xadAddDiskEntry() to
  1397.     set the input file position after the entry was added. This is
  1398.     normally always necessary in case XADDIF_EXTRACTONBUILD or
  1399.     XADFIF_EXTRACTONBUILD is supported.
  1400.  
  1401.       XAD_STARTCLIENT        (struct xadClient *) (V7)
  1402.     As there may be multiple filesystems on one disk image file (e.g.
  1403.     standard AmigaOS filesystem hiding an other one), it is useful to
  1404.     rescan the file. If you call xadGetDiskInfo() with this tagitem
  1405.     set to the client which comes after the one found in previous run
  1406.     (ai->xai_Client->xc_Next), you may detect such double systems also.
  1407.     May be passed to xadGetDiskInfo().
  1408.  
  1409.       XAD_WASERROR        (LONG) (V8)
  1410.     Allows to supply an error number to xadFreeHookAccess(), which
  1411.     occured by accessing hooks. Supplying this results an calling the
  1412.     abort method of hooks.
  1413.  
  1414. xadmaster.library/-- data hooks--            xadmaster.library/--data hooks--
  1415.  
  1416.     GENERAL
  1417.         You have four methods of passing data to xadmaster.library: file-
  1418.         names, filehandles, memory areas and hooks. The hooks are described
  1419.         here. The hook field h_Entry has to be standard hook functions and
  1420.         gets called with the hook itself in A0 and a pointer to a
  1421.         xadHookParam in A1. Commands are stored in xhp_Command field, data
  1422.         in the other fields. Return values are 0 or any of the XADERR codes.
  1423.         Unsupported commands are returned with XADERR_NOTSUPPORTED.
  1424.  
  1425.         You may store a pointer to private data in the field xhp_PrivatePtr.
  1426.         You always get a XADHC_FREE after work to enable you freeing your
  1427.         resources.
  1428.  
  1429.         Whenever an error occured, the hook gets called with XADHC_ABORT.
  1430.         Use this to delete partial file, free useless memory or whatever
  1431.         you used. You must not do cleanup stuff on XADHC_ABORT call, as 
  1432.         XADHC_FREE call follows after it.
  1433.         
  1434.         NOTE: Because hooks are not called in program environment, they
  1435.         cannot be used in small data model of some compilers, as register
  1436.         A4 is not passed through. So the hook either has to be compiled in
  1437.         large data model or should use __saveds keyword of some compilers.
  1438.  
  1439.     The field xhp_TagList may contain additional tags. Currently only
  1440.     XADAC_WRITE uses this.
  1441.  
  1442.     COMMANDS
  1443.       XADHC_READ                (input hooks only)
  1444.         This command is called all time xadmaster.library needs some data.
  1445.         Fill the supplied memory area with input data of needed size.
  1446.         Input:  xhp_BufferSize  size of required data
  1447.                 xhp_BufferPtr   buffer to fill
  1448.         Output: xhp_DataPos     buffer position after read
  1449.  
  1450.       XADHC_WRITE               (output hooks only)
  1451.         This function is called, if some data should be stored. Copy
  1452.         the contents of buffer to your data storing system.
  1453.         Input:  xhp_BufferSize  size of data
  1454.                 xhp_BufferPtr   pointer to memory area
  1455.         Output: xhp_DataPos     buffer position after write
  1456.         Tags:   xhp_TagList     may contain XAD_SECTORLABELS info
  1457.  
  1458.       XADHC_SEEK                (both)
  1459.         Change the current position in your data (like dos.library Seek
  1460.         command). The offset you have to seek is always relative to
  1461.         current position. It can be negative too. Seek's with size 0 can
  1462.         be used to get current file position.
  1463.         Input:  xhp_CommandData offset you have to seek
  1464.         Output: xhp_DataPos     buffer position after seek
  1465.  
  1466.       XADHC_INIT                (both)
  1467.         The work starts. Allocate needed structures and initialize your
  1468.         stuff. Clear xhp_BufferPos.
  1469.         Input:  none
  1470.         Output: none
  1471.  
  1472.       XADHC_FREE                (both)
  1473.         You get this when work is finished, free all your stuff now. You
  1474.         need to clear all pointers you use for checking, as it may happen
  1475.         that you get multiple XADHC_FREE commands.
  1476.         Input:  none
  1477.         Output: none
  1478.  
  1479.       XADHC_ABORT               (output hooks only)
  1480.         You get this when work was aborted, because an error occured.
  1481.         Free all work stuff. Buffers must be freed by later XADHC_FREE call.
  1482.         Be prepared to get multiple XADHC_ABORT commands.
  1483.         Input:  none
  1484.         Output: none
  1485.  
  1486.       XADHC_FULLSIZE            (input hooks only)
  1487.         The hook should return complete size of input data which should be
  1488.         processed.
  1489.         Input:  none
  1490.         Output: xhp_CommandData size of input file
  1491.  
  1492.       XADHC_IMAGEINFO        (input hooks only) (V4)
  1493.     The hook should return information about disk image file. Normally
  1494.     hooks return XADERR_NOTSUPPORTED for this, like for all unsupported
  1495.     commands. Only the internal disk archive hook is able to return
  1496.     useful data.
  1497.     Input:    xhp_CommandData contains pointer to xadImageInfo structure,
  1498.         which should be filled
  1499.     Output: xadImageInfo structure in xhp_CommandData is filled with data
  1500.  
  1501. xadmaster.library/-- progress hooks--    xadmaster.library/--progress hooks--
  1502.  
  1503.     GENERAL
  1504.         This hook can be used to do display completion reports or ask the
  1505.         user. It gets a pointer to a xadProgressInfo structure. The hook
  1506.         returns a combination of XADPIF flags. A return value without
  1507.         XADPIF_OK (mostly 0) means a break command. Normally a hook should
  1508.         check for <CTRL>-<C> presses (or any other break condition) and add a
  1509.         XADPIF_OK to return value when no break condition exists.
  1510.  
  1511.         A progress hook must not support all possibilities! For example hooks
  1512.         from file unarchiving utilities never need an XADPIF_IGNOREGEOMETRY
  1513.         check. Also they need not support renaming or any other stuff. But
  1514.         the more they support, the better the user can work with the tool!
  1515.  
  1516.     MODES
  1517.       XADPMODE_ASK
  1518.         The master library has some problems, which need user interaction.
  1519.         The implementation of the user interaction depends on the
  1520.         application. The xpi_Status holds information what question needs to
  1521.         be answered. When XADPIF_OVERWRITE is set, the hook must determine if
  1522.         the file should be overwritten, renamed or not. The return flags
  1523.         must be set corresponding to this decision. Same is for
  1524.         XADPIF_IGNORGEGEOMETRY and XADPIF_MAKEDIRECTORY flag.
  1525.  
  1526.         XADPIF_IGNOREGEOEMTRY
  1527.           The hook either returns XADPIK_OK|XADPIF_IGNOREGEOMETRY or only
  1528.           XADPIF_OK, when user doesn't think geometry can be ignored.
  1529.  
  1530.         XADPIF_MAKEDIRECTORY
  1531.           The hook either returns XADPIK_OK|XADPIF_MAKEDIRECTORY or only
  1532.           XADPIF_OK, when user doesn't want to make directory.
  1533.  
  1534.         XADPIF_OVERWRITE
  1535.           The destination file already exists. The user should get 6 chances
  1536.           now (named with some standard letters).
  1537.           N - Do not do anything. The hook returns XADPIF_OK.
  1538.           Y - Turn overwrite on. The hook returns XADPIF_OK|XADPIF_OVERWRITE.
  1539.           A - Turn overwrite on for all files. The hook stores this
  1540.               information and returns XADPIF_OK|XADPIF_OVERWRITE. All
  1541.               following XADPIF_OVERWRITE requests are automatically answered
  1542.               with this return.
  1543.           S - Skip that file. The hook returns XADPIF_OK|XADPIF_SKIP.
  1544.           Q - Quit the program. The hook returns XADPIF_OK and the program
  1545.               quits before next call.
  1546.           R - The user wants to rename the file. The hook calls xadAllocVec()
  1547.               to get some memory for the name and passes this in xpi_NewName.
  1548.               This memory is freed by xadmaster.library afterwards!
  1549.               The return value is XADPIF_OK|XADPIF_RENAME.
  1550.  
  1551.         XADPIF_ISDIRECTORY
  1552.           The destination file already exists. The user should get 4 chances
  1553.           now (named with some standard letters).
  1554.           R - The user wants to rename the file. The hook calls xadAllocVec()
  1555.               to get some memory for the name and passes this in xpi_NewName.
  1556.               This memory is freed by xadmaster.library afterwards!
  1557.               The return value is XADPIF_OK|XADPIF_RENAME.
  1558.           N - Do not do anything. The hook returns XADPIF_OK.
  1559.           S - Skip that file. The hook returns XADPIF_OK|XADPIF_SKIP.
  1560.           Q - Quit the program. The hook returns XADPIF_OK and the program
  1561.               quits before next call.
  1562.  
  1563.       XADPMODE_END
  1564.         This is the last progress display with final results.
  1565.  
  1566.       XADPMODE_ERROR
  1567.         An error occured. The error value is in xpi_Error field.
  1568.  
  1569.       XADPMODE_PROGRESS
  1570.         Normal progress display. Depending on data type (disk/file), some
  1571.         progress information can be displayed.
  1572.  
  1573.       XADPMODE_NEWENTRY (V10)
  1574.     This indicates, that either a new file or disk entry has been added.
  1575.     If the flag XADDIF_EXTRACTONBUILD or XADFIF_EXTRACTONBUILD is set, the
  1576.     file maybe extracted immediately, although this is not recommended.
  1577.     Generally this can be used for progress displays and to abort
  1578.     scanning.
  1579.  
  1580.     RETURN VALUES
  1581.       0 or anything without XADPIF_OK
  1582.         The work should be aborted. The master library returns XADERR_BREAK.
  1583.  
  1584.       XADPIF_OK
  1585.         No break condition occured. The normal return value for progress
  1586.         display. Also used when user choosed to answer NO to XADPMODE_ASK
  1587.         questions.
  1588.  
  1589.       XADPIF_OK|XADPIF_IGNOREGEOMETRY
  1590.         User choosed that drive geometry can be ignored.
  1591.  
  1592.       XADPIF_OK|XADPIF_MAKEDIRECTORY
  1593.         User choosed that directory should be created.
  1594.  
  1595.       XADPIK_OK|XADPIF_OVERWRITE
  1596.         User choosed that file should be overwritten.
  1597.  
  1598.       XADPIF_OK|XADPIF_RENAME
  1599.         User choosed that file should be renamed. The field xpi_NewName must
  1600.         contain a memory block allocated with xadAllocVec() which holds a new
  1601.         file name. This block is freed by xadmaster.library afterwards!
  1602.  
  1603.       XADPIF_OK|XADPIF_SKIP
  1604.         User choosed to skip that file. The master library returns XADERR_SKIP
  1605.         in that case.
  1606.  
  1607.